<?php

namespace App\Models;

use Illuminate\Support\Arr;
use Illuminate\Database\Eloquent\Model;

class XcRechargeSetting extends Model
{
    protected $table = 'xc_recharge_setting';
    protected $guarded = ['id'];

    protected $appends = ['type_name'];

    public function getTypeNameAttribute()
    {
        return $this->attributes['type_name'] = Arr::get([1 => '充值卡', 2 => '年卡', 3 => '季卡', 4 => '月卡', 5 => '次卡'], $this->type);
    }
}
